package top.zhangjianyong.tools.utils;

import org.springframework.util.DigestUtils;

import java.io.UnsupportedEncodingException;

/**
 * @author ： zhangjianyong
 * @date ： 2022/4/24 下午4:31
 */
public class PasswordUtil {

    private final static String KEY = "33017a4427554c8baf8f30743b8fa65d";

    public static String md5(String password) throws UnsupportedEncodingException {

        return DigestUtils.md5DigestAsHex((password + KEY).getBytes("utf-8"));

    }

    public static void main(String[] args) throws UnsupportedEncodingException {

        System.out.println(md5("12345"));
    }
}
